Before Clarity

نویسنده

  • Michael C. Feathers
چکیده

I f you're at all like me, you've spent a lot of time thinking about what makes " good design " good. Most software developers become preoccupied with this question at some point in their careers, usually after witnessing the effects of bad design first hand. At that point, we start to reflect. We go through a stage where we feel we know what good design is but can't really define it. Then we learn various design principles and rules of thumb that make it easier to judge what constitutes good design. But when these principles and rules conflict, we have to make trade-offs and decide what's most important in each situation. To help me out, a few years ago I created my own blanket rule of thumb: Keep design as clear as possible. I was pretty sure that, regardless of the trade-offs, the most important thing was clarity. If a system uses a straightforward coding style—the classes and methods are well named and small enough to be clearly understood, and the system isn't littered with snarls of obscure code—then you can do just about anything. You can change the system with impunity, write tests for it, make adjustments , and add features, all with relative ease. So " clear design is good design " seemed like a reasonable rule of thumb because so much of what makes code impossible to maintain comes down to a lack of clarity. If you can understand your system, you can change it effectively. If you can't, it's much harder. Sounds simple and straightforward, right? Well, it might be a little too simple. Recently, I've discovered that I'm periodically sacrificing clarity and subordinating it to another standard. Let's take a look at an example. In Figure 1, we have some reasonably clear code for a method on a C++ class in a trading application. The adjustedShares method computes the number of shares that should be sold under certain circumstances. To do this, it gets information from a static method named getRateAdjustment on a class named TradeUtils. TradeUtils is just a utility class. All of its methods are static. So, what would we do if we needed to change the way getRateAdjustment calculates baseAdjustment? The answer seems relatively straightforward—we'd go into the code and change the calculation. But how would we know if we got it right? The most direct way to ensure that our …

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Quality improvement of medical records in a teaching hospital.

INTRODUCTION The aim of this study was to evaluate the quality of the MR compilation in some Operative Units of the "Azienda Ospedaliera Universitaria--II Università di Napoli" (AOU- SUN)-Italy, before and after an intervention of quality improvement, underlining the potential differences in the behaviour of different specialists (physicians vs. surgeons). METHODS Two random samples of 660 MR...

متن کامل

Clarity and the grammar of skepticism 1

Why ever assert clarity? If It is clear that p is true, then saying so should be at best superfluous. Barker and Taranto (2003) and Taranto (2006) suggest that asserting clarity reveals information about the beliefs of the discourse participants, specifically, that they both believe that p. However, mutual belief is not sufficient to guarantee clarity (It is clear that God exists). I propose in...

متن کامل

Graduating from high school : The role of gender - related attitudes , self - concept and goal clarity in a major transition in late adolescence

An 11-month longitudinal study (T1: N = 520, M age = 19 years) investigated the role of gender-related self-concept and goal clarity during the transition period surrounding graduation from upper secondary school in Switzerland. The first assessment took place a few months before graduation and assessed participants’ gender-related self-concept (instrumentality, expressivity), gender-role attit...

متن کامل

Learning in interprofessional teams: AMEE

This guide is for health and social care professionals who teach or guide others’ learning before and after qualification, in formal courses or the workplace. It clarifies the understanding of interprofessional learning and explores the concept of teams and team working. Illustrated by examples from practice, the practicalities of effective interprofessional learning are described, and the unde...

متن کامل

Reporting behaviour change interventions: do the behaviour change technique taxonomy v1, and training in its use, improve the quality of intervention descriptions?

BACKGROUND Behaviour change interventions are likely to be reproducible only if reported clearly. We assessed whether the behaviour change technique taxonomy version 1 (BCTTv1), with and without training in identifying BCTs, improves the clarity and replicability of written reports of observed behaviour change interventions. METHODS Three studies assessed effects of using and training in the ...

متن کامل

Bringing CLARITY to the human brain: visualization of Lewy pathology in three dimensions

AIMS CLARITY is a novel technique which enables three-dimensional visualization of immunostained tissue for the study of circuitry and spatial interactions between cells and molecules in the brain. In this study, we aimed to compare methodological differences in the application of CLARITY between rodent and large human post mortem brain samples. In addition, we aimed to investigate if this tech...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • IEEE Software

دوره 21  شماره 

صفحات  -

تاریخ انتشار 2004